//
import hash from '@ohos.file.hash'
// kxf   28/12/23 4:49 pm
//form表单的 抽象行为
//
export interface FormAction {

    getID(): string

    hasError():boolean /// 检查失败

    getSubmit(): SubmitData

    setValue(v: string)//fuZhi

    showHide(v: boolean)// true show  false hide

    parentView(): any

    isAsy(): boolean //默认 true false 用于上传图片 这种厌世操作

    asyOk() //对应上面 延迟操作后续逻辑
}

/**
 * 提交的表单数据
 */
export class SubmitData {
    private hm = new Map<string, string>()

    constructor(k: string, v: string) {
        this.hm.set(k, v)
    }

    add(k: string, v: string) {
        this.hm.set(k, v)
    }

    get(): Map<string, string> {
        return this.hm
    }
}

declare const FormIm: FormAction